import http from '@/utils/http'

/**
 * 获取班级列表
 */
export const getClassesApi = async(param) => {
  return http.get('/api/student/getClass', param)
}

/**
 * 获取角色列表
 */
export const getRolesApi = async() => {
  return http.get('/api/student/getRoles', null)
}

/**
 * 添加学生信息
 */
export const addStuApi = async(param) => {
  return http.post('/api/student', param)
}

/**
 * 修改学生信息
 */
export const editStuApi = async(param) => {
  return http.put('/api/student', param)
}

/**
 * 根据id删除学生信息
 */
export const deleteStuApi = async(param) => {
  return http.delete('/api/student', param)
}

/**
 * 根据id查询学生信息，编辑回显
 */
export const getStuApi = async(param) => {
  return http.get('/api/student/getById', param)
}

/**
 * 根据查询学生信息
 */
export const getStuListApi = async(param) => {
  return http.get('/api/student/getList', param)
}

/**
 * 根据学生id查询角色id
 */
export const getRoleIdApi = async(param) => {
  return http.get('/api/student/getRoleId', param)
}

/**
 * 查询学生课程
 */
export const getCourseListApi = async(param) => {
  return http.get('/api/student/getCourseList', param)
}

/**
 * 根据id查询学生信息，编辑回显
 */
export const resetPasswordApi = async(param) => {
  return http.post('/api/student/resetPassword', param)
}

/**
 * 导入学生信息API
 *
 */
export const importStuInfoApi = async(param) => {
  return http.upload('/api/student/importStuInfo', param)
}

/**
 * 异步获取学生数量的API
 *
 */
export const getStuCountApi = async() => {
  return http.get('/api/student/getStuCount', null)
}
/**
 * 获取热门专业的API函数
 *
 */
export const getHotMajorApi = async() => {
  return http.get('/api/student/getHotMajor', null)
}
